//
//  LzwSeaDetailCell.m
//  NewHalfsugar
//
//  Created by 刘志武 on 16/1/5.
//  Copyright © 2016年 刘志武. All rights reserved.
//

#import "LzwSeaDetailCell.h"
#import "UIImageView+WebCache.h"
#import "LzwBaseImageView.h"
#import "LzwBaseLable.h"

@interface LzwSeaDetailCell ()

@property (nonatomic, retain) LzwBaseImageView *myIamgeSeaD;
@property (nonatomic, retain) LzwBaseImageView *myIamgeSeaD1;

@property (nonatomic, retain) LzwBaseLable *myLableSeaD;
@property (nonatomic, retain) LzwBaseLable *myLableSeaD1;


@end

@implementation LzwSeaDetailCell

-(void)dealloc{
    [_myIamgeSeaD release];
    [_myIamgeSeaD1 release];
    [_myLableSeaD release];
    [_myLableSeaD1 release];
    [super dealloc];
    
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        [self creat];
    }
    return self;
}

- (void)creat{
    
    //图片
    self.myIamgeSeaD = [[LzwBaseImageView alloc]initWithFrame:CGRectMake(3 * WIDTH, 3 * WIDTH, 370 * WIDTH, 180 * WIDTH)];
    self.myIamgeSeaD.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:self.myIamgeSeaD];
    
    //喜爱图片
    self.myIamgeSeaD1 = [[LzwBaseImageView alloc]initWithFrame:CGRectMake((375 - 20) / 2 - 70 * WIDTH, 230 * WIDTH, 20 * WIDTH, 20 * WIDTH)];
    self.myIamgeSeaD1.image = [UIImage imageNamed:@"love.png"];
    [self.contentView addSubview:self.myIamgeSeaD1];
    
    //描述
    self.myLableSeaD = [[LzwBaseLable alloc]initWithFrame:CGRectMake(2 * WIDTH, 185 * WIDTH, 369 * WIDTH, 45 * WIDTH)];
    self.myLableSeaD.textColor = [UIColor lightGrayColor];
    self.myLableSeaD.font = [UIFont systemFontOfSize:16 * WIDTH];
    self.myLableSeaD.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:self.myLableSeaD];
    
    //喜爱人数
    self.myLableSeaD1 = [[LzwBaseLable alloc]initWithFrame:CGRectMake((375 - 20) / 2 - 50 + 5 * WIDTH, 230 * WIDTH, 60 * WIDTH, 20 * WIDTH)];
    self.myLableSeaD1.textColor = [UIColor lightGrayColor];
    self.myLableSeaD1.font = [UIFont systemFontOfSize:16 * WIDTH];
    self.myLableSeaD1.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:self.myLableSeaD1];
    
    [_myIamgeSeaD release];
    [_myIamgeSeaD1 release];
    [_myLableSeaD release];
    [_myLableSeaD1 release];
    

}

-(void)setModleSeadetail:(LzwSeaDeModle *)modleSeadetail{
    
    if (_modleSeadetail != modleSeadetail) {
        [_modleSeadetail release];
        _modleSeadetail = [modleSeadetail retain];
    }
    
    self.myLableSeaD.text = self.modleSeadetail.title;
    self.myLableSeaD1.text = self.modleSeadetail.likes;
    
    
    NSURL *url = [NSURL URLWithString:self.modleSeadetail.pic];
    
    [self.myIamgeSeaD sd_setImageWithURL:url placeholderImage:nil];
    

    NSLog(@"dsdsdsds = %@", self.myIamgeSeaD);
    
}


@end
